[sonjh1217] WEEK 01 solutions#1985
Merged
sonjh1217 merged 2 commits intoDaleStudy:mainfrom Nov 17, 2025
Merged
Conversation
Contributor
|
안녕하세요! 문제는 푸시는 대로 확인해보고 리뷰 남기겠습니다. |
ZetBe
reviewed
Nov 12, 2025
Comment on lines
+3
to
+12
| func containsDuplicate(_ nums: [Int]) -> Bool { | ||
| var numSet = Set<Int>() | ||
| for num in nums { | ||
| if numSet.contains(num) { | ||
| return true | ||
| } | ||
| numSet.insert(num) | ||
| } | ||
|
|
||
| return false |
Contributor
There was a problem hiding this comment.
swift에서 Set을 사용하였군요
저는 조금 다른 방식으로 풀었는데
Set같은 자료구조가 아닌 주어진 리스트를 정렬 후,
1번 인덱스 부터 현재 인덱스랑 이전 인덱스 비교하며 중복이면 True를 리턴하도록 작성했습니다.
하지만 정렬 자체가 시간 부분에서 O(n*logn)이라 추천하지는 않습니다
코드 리뷰가 처음이라 메일이 계속 왔을텐데.. 다음부터는 제대로 리뷰하겠습니다..
TonyKim9401
approved these changes
Nov 16, 2025
Contributor
TonyKim9401
left a comment
There was a problem hiding this comment.
1주차 문제 풀이 고생하셨습니다!
온보딩 및 스터디 적응 하시는데 앞으로 조금 더 힘내주시고 앞으로의 15주간 여정 응원합니다.
2주차 문제 풀이도 파이팅입니다!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!